package com.ericcson.innerportalapp;

import android.app.ListFragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class MainListFragment extends ListFragment {
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
		switch (position) {
		case 0:
			Intent peopleIntent = new Intent(getActivity(), PeopleActivity.class);
			getActivity().startActivity(peopleIntent);
			break;
			
		case 1:
			Intent announcementIntent = new Intent(getActivity(), AnnouncementsList.class);
			getActivity().startActivity(announcementIntent);
			break;
			
		case 2:
			Intent toDoListIntent = new Intent(getActivity(), ToDoListActivity.class);
			getActivity().startActivity(toDoListIntent);
			break;
			
		case 3:
			Intent emergencyIntent = new Intent(getActivity(), EmergencyActivity.class);
			getActivity().startActivity(emergencyIntent);
			break;
			
		case 4:
			Intent officeListIntent = new Intent(getActivity(), OfficeLocationActivity.class);
			getActivity().startActivity(officeListIntent);
			break;

		default:
			break;
		}
	}
}
